var dateType = '1',  //日期类型
    dateStart = '', //开始日期
    dateEnd = '',   //结束日期
	leftListID = '';
//用户选择
function selectSH(id) {
	var te = $("#SH").attr("btnType");
	if(te == "隐藏") {
		$("#SH").attr("btnType", "显示");
		$("#selectBox").fadeIn(600, function() {
			$("#selectBox").css("display", "block")
		})
	}
	if(te == "显示") {
		$("#SH").attr("btnType", "隐藏");
		$("#selectBox").fadeOut(600, function() {
			$("#selectBox").css("display", "none")
		})
	}
}
//用户选择结束

//设置session参数
function setSessionfunc(typeid,zid){
	//设置当前用户的session值
    //typeid 系统分类id (比如对应前端八大类), zid 当前用户的站点id
	var url="/bigscrenn/setUserSession?typeid="+typeid+"&zid="+zid;
    $.ajax({
	     cache: true,
	     type: "POST",
	     url:url,
	     data:"",
	     async: false,				   
	     success: function(data){
              console.log(data,'参数');         
	     }
    		
    });	
};
setTimeout(hisVueFunc,500);
//日期时间查询开始
function hisVueFunc() {
	new Vue({
		el : "#app",
		data : {
			userid : "",   //用户id
			unitID : "",   //单位id
			userType : "", //用户类型
			kehu : [],     //左边列表
			zhandian : [], //站点数组
			zid : "",      //站点id
			zName:'',       //站点名称
		    danweiID:'',    //单位id
		    danweiName:'',   //单位名称
 		},
		mounted : function() {
			//this.getData();
			this.getSession();
		},
		
		methods : {
			//session
			getSession:function(){
				var vs = this;
				var userid,unitID,userType;
				var url="/bigscrenn/getUserSession";
			     $.ajax({
				     cache: true,
				     type: "POST",
				     url:url,
				     data:"",
				     async: false,				   
				     success: function(data){
				    	 console.log("session数据：",data);
				    	 //js解析json串
			     	     var obj = JSON.parse(data);
			             if (obj.session.length>0){
			                   /*alert(obj.session[0].UserID);//用户id
			                   alert(obj.session[0].Name);//用户名称
			                   alert(obj.session[0].UnitID);//用户单位id
			                   alert(obj.session[0].UserAuthority);//用户权限 2 所有单位 3 本单位
			                   alert(obj.session[0].typeid);//系统分类id (比如对应前端八大类)
			                   alert(obj.session[0].zid);//当前用户的站点id*/			            	   
			            	   vs.userid = obj.session[0].UserID;
			 	  			   vs.unitID = obj.session[0].UnitID;
			 	  			   vs.userType = obj.session[0].UserAuthority;
			 	  			   //vs.zid = obj.session[0].zid;
			 	  			   
			 	  			   vs.danweiID = (obj.session[0].cid1).split(",")[0];  //单位id方法
			 	  			   vs.danweiName = (obj.session[0].cid1).split(",")[1];//上页选中来的单位名称
			 	  			   
			 	  			   //vs.zid = obj.session[0].zid;
			 	  			   vs.zid = (obj.session[0].zid).split(",")[0];  //站点id
			 	  			   vs.zName = (obj.session[0].zid).split(",")[1];//上页选中来的站点名称
			 	  			   //alert("历史曲线 vs.danweiID="+vs.danweiID + " vs.danweiName= "+vs.danweiName +"vs.zid = "+vs.zid +"vs.zName = "+vs.zName);
			 	  			   
			 	  			   zhandianid = vs.zid;
			 	  			   onlineFunc();
			 	  			   
			 	  			   $('#topTitle').text(vs.zName);
			 	  			   
			 	  			   console.log("站点id="+vs.zid);
			 	  			   //setSessionfunc('',vs.zid+','+vs.zName,'',(vs.danweiID+','+vs.danweiName));     // session存站点（第二个参）
			 	  			   
			 	  			   vs.getData(vs.zid);
			             }
			                 //alert("vs.zid= "+vs.zid+"userid="+vs.userid+"and unitID="+vs.unitID+"and userType="+vs.userType) ;
			                 
			             if(vs.danweiID==undefined||vs.danweiID==''){
		                	 vs.danweiID=vs.unitID;
		                 }
		                if(vs.zid && vs.zid != '' && vs.zid != null && vs.zid!= undefined){
		                	vs.getUnitIData(vs.userid,vs.danweiID);
		                }
		                //具体用户进来的操作
		                if(vs.userType==3){
		                	console.log("我的身份是具体用户");
		                	$(".backHome-box >a").css("display","none");// “返回首页”隐藏
		                }
				     }
			     });
			},
			//站点列表
			getUnitIData:function(sy_userid,sy_uniId){
				var unitData = this;
				// userid用户id,unitid单位id,unitid为空时表示调用多个单位的站点信息
			    var url="/bigscrenn/getSiteList?userid="+sy_userid+"&unitid="+sy_uniId;
			     $.ajax({
				     cache: true,
				     type: "POST",
				     url:url,
				     data:"",
				     async: false,				   
				     success: function(data){
                       // alert(data);
                       // js解析json串
                       var obj = JSON.parse(data);
                       // alert(obj.total);//记录数
                       unitData.zhandian = obj.rows;// 分类后的站点（用户）
                       
                       //====
                       var zd=obj.rows;
                       for(var i = 0;i<unitData.zhandian.length;i++){
                    	   	$("#zhanDianDl").append('<dd><a class="zhanDian" cid='+obj.rows[i].CID+'>'+obj.rows[i].UNITNAME+'</a></dd>')
                       }
                       //====
                       
                       // unitData.getPicData(obj.rows[0].CID);//电气图ID（进入页面时默认第一个站点的电气图）
                       // alert("========="+obj.rows[0].CID);
                       unitData.$nextTick(function() {
                    	   var arrr = $(".zhanDian");
                    	   // alert("arrr=="+arrr.length);
                    	   var firstACID = $(".zhanDian:first()").attr("cid");
                    	   localStorage.setItem("energyCID", firstACID);// 没有点击存储本页第一个的站点CID覆盖homecid
                    	   var thisCid="";
                    	   for (var n=0;n<arrr.length;n++){
                    		   arrr[n].index = n;
                    		   arrr[n].onclick = function(){
                    			    //alert($(this).text()+" 站点id = "+$(this).attr("cid"));
                    			   thisCid = $(this).attr("cid");
                    			   //setSessionfunc('',thisCid);                   //session存参
                    			   setSessionfunc('',thisCid+','+$(this).text(),'',(unitData.danweiID+','+unitData.danweiName));     // session存站点（第二个参）
                    			   window.location.href = "./specificUser.html";// 返回具体页面
                    		   }
                    		   
                    	   }
                       });
				     }
			     });
			},
			getData : function(zhandian) {
				var vm = this;
				//得到图表左边菜单列表
				//这里的unitid 代表站点
				//var url = "/bigtongji/getChartSetupList?unitid=000000000001";
				var url = "/bigtongji/getChartSetupList?unitid="+zhandian;
				$.ajax({
					cache : true,
					type : "POST",
					url : url,
					data : "",
					async : false,
					success : function(data) {
						//alert("历史曲线左边菜单地址====" + url);
						//alert("历史曲线左边菜单数据====" + data);
						console.log("历史曲线====" + data);
						var obj = JSON.parse(data);
						for (var i = 0; i < obj.rows.length; i++) {
							vm.kehu.push({
								"name" : obj.rows[i].CNAME,
								"id" : obj.rows[i].CID
							});
						}
						//alert("vm.kehu = "+vm.kehu);
						vm.$nextTick(function() {
							var deFaultId = $("#dl>dd:first() a").text();
							//默认显示
							
							$("#dl>dd:first() a").addClass("sideActive");
							
							leftListID = $(".sideActive").attr('id');
							if($(".show >input").length==1){
								dateStart = $(".show input").val();
								dateEnd = '';
							}
							if($(".show >input").length==2){
								dateStart = $(".show input").eq(0).val();
								dateEnd = $(".show input").eq(1).val();
							}
							dateType = $('.xz').find('input').attr('dateType');     //获取type，
							
							test22();
							
							$("#thisTitle").text($("#dl>dd:first() a").text());// 默认选中第一对应标题
							layui.use('element', function() {
								var element = layui.element; // 导航的hover效果、二级菜单等功能，需要依赖element模块

								// 监听导航点击
								element.on('nav(demo)', function(elem) {
									// console.log(elem)
									//alert(elem.text());
									$("#thisTitle").text(elem.text());// 选中选项对应标题
									$("#dl>dd a").removeClass("sideActive");
									$(this).addClass("sideActive");
									
									leftListID = $(this).attr("id");
									if($(".show >input").length==1){
										dateStart = $(".show input").val();
										dateEnd = '';
									}
									if($(".show >input").length==2){
										dateStart = $(".show input").eq(0).val();
										dateEnd = $(".show input").eq(1).val();
									}
									dateType = $('.xz').find('input').attr('dateType');     //获取type，
									
									test22();
									
								});
							});
						})
					}
				});
			}
		}
	})
	
}
//日期时间查询结束
function func(){
	
	leftListID = $(".sideActive").attr('id');
	if($(".show >input").length==1){
		dateStart = $(".show input").val();
		dateEnd = '';
	}
	if($(".show >input").length==2){
		dateStart = $(".show input").eq(0).val();
		dateEnd = $(".show input").eq(1).val();
	}
	dateType = $('.xz').find('input').attr('dateType');     //获取type，
	
	test22();
}
//今日，上周，上个月，近三个月 开始
// 得到图表接口
// unitid是左边菜单的ID
// sdate 需要查询的开始时间
// edate 需要查询的结束时间
// type 类型 1，24小时，2 30天，3 12月，4 4季度，5年
$(function() {

	$(".am-radio-inline").removeClass('xz');
	$(".am-radio-inline").eq(0).addClass('xz');
	secondLiTab = $(".am-radio-inline");
	secondLiTab.click(function() {
		var index = secondLiTab.index(this);
		$(".am-radio-inline").removeClass('xz');
		$(".am-radio-inline").eq(index).addClass('xz');
		
		leftListID = $(".sideActive").attr('id');
		if($(".show >input").length==1){
			dateStart = $(".show input").val();
			dateEnd = '';
		}
		if($(".show >input").length==2){
			dateStart = $(".show input").eq(0).val();
			dateEnd = $(".show input").eq(1).val();
		}
		dateType = $('.xz').find('input').attr('dateType');     //获取type，
		
		
		test22();
	});
})
// unitid是左边菜单的ID
// sdate 需要查询的开始时间
// edate 需要查询的结束时间
// type 类型 1，24小时，2 30天，3 12月，4 4季度，5年
function test22() {
	if(dateType==4 || dateType=="4"){
		dateType=5
	}
	var Xarr = [];
	//var url = "/bigtongji/getChartSetupListRelist?unitid=000000000001&sdate=2018-12-13&edate=2019-12-13&type=1";
	var url = "/bigtongji/getChartSetupListRelist?unitid="+leftListID+"&sdate="+dateStart+"&edate="+dateEnd+"&type="+dateType;
	//alert("进来了url为=="+url);
	$.ajax({
		cache : true,
		type : "POST",
		url : url,
		data : "",
		async : false,
		success : function(data) {
			console.log("new 历史曲线==="+data);
			//alert("new 历史曲线==="+data);
			var dataObj;
			if(data&&data!=null&&data!=undefined){
				dataObj = eval("(" + data + ")");// 转换为json对象
			}
			// //alert(dataObj);
			//alert(dataObj);
			//alert(dataObj.rows.length);
			var legenArr = [];
			if(dataObj&&dataObj.rows.length>0){
				for(var n=0;n<dataObj.rows.length;n++){
					legenArr.push(dataObj.rows[n].genusName);
					console.log("dataObj.rows[n].genusName="+dataObj.rows[n].genusName);
				}
			}
			console.log(JSON.stringify("legenArr="+legenArr));
			// //alert(dataObj.rows.length);//输出root的子对象数量
			
			var SmalltypeName = [];
			var typeName = [];
			var map = new Array();// 装数值
			var map2 = new Array();//
			var arr = new Array(); // 装时间
			var danwei = [];
			var valueArr = [];    //置 add 2019-3-22
			if(dataObj && dataObj.rows.length>0){
				for (var i = 0; i < dataObj.rows.length; i++) {
					arr[i] = new Array(i); // 一维数组
					map2.push(dataObj.rows[i].genusName);// 一维数组
					arr[i] = new Array(i);
					map[i] = new Array(i);
					danwei[i] = new Array(i);
					valueArr[i] = new Array(i);
					for (var j = 0; j < dataObj.rows[i].speciesList.length; j++) {
						// map[i].push(dataObj.rows[i].speciesList[j].NAMES);
						arr[i][j] = dataObj.rows[i].speciesList[j].NAMES;
						map[i][j] = dataObj.rows[i].speciesList[j].VALUEA+dataObj.rows[i].speciesList[j].CONVERSION;
						danwei[i][j] = dataObj.rows[i].speciesList[j].CONVERSION;
						valueArr[i][j] = dataObj.rows[i].speciesList[j].VALUEA;
					}

				}
			}
			console.log("valueArr = "+JSON.stringify(valueArr));
			//alert(("danwei="+danwei.length));
			//单位
			var dw = [];
			for (var d = 0; d < danwei.length; d++) {
				dw = danwei[d];
			}
			//alert("dw========"+JSON.stringify(dw));
			console.log(JSON.stringify(arr));
			console.log(JSON.stringify(map));
			console.log(JSON.stringify(map2));

			var typeName = [];
			for (var i = 0; i < arr.length; i++) {
				/*
				 * for(var j=0;j<arr[i].length;j++){ typeName.push(arr[i][j]); }
				 */
				typeName = arr[i];
				console.log(JSON.stringify(typeName));
			}
			console.log("arr========"+JSON.stringify(typeName));
			console.log("横轴typeName="+typeName);
			if(typeName&&typeName!=''&&typeName!=null&&typeName!=undefined){
				Xarr = typeName;  //横轴
			}
			
			//alert("刚刚进来Xarr="+Xarr);
			localStorage.setItem("Xarr",Xarr); 
			var mapName1 = [];
			var mapName2 = [];
			var mapName3 = [];
			var mapName4 = [];
			for (var i = 0; i < map.length; i++) {
				// 只有一条数据
				if (map.length == 1) {
					mapName1 = map[0];
					// 只有两条数据
				} else if (map.length == 2) {
					mapName1 = map[0];
					mapName2 = map[1];
				} else if (map.length == 3) {
					mapName1 = map[0];
					mapName2 = map[1];
					mapName3 = map[2];
				} else if (map.length == 4) {
					mapName1 = map[0];
					mapName2 = map[1];
					mapName3 = map[2];
					mapName4 = map[3];
				}
			}
			console.log("mapName1历史曲线==="+JSON.stringify(mapName1));
			console.log("mapName2历史曲线==="+JSON.stringify(mapName2));
			console.log("mapName3历史曲线==="+JSON.stringify(mapName3));
			
			var newarr1 = [],newarr2 = [],newarr3 = [];
			for (var i = 0; i < mapName1.length; i++) {
				newarr1.push(parseFloat(mapName1[i]));
			}
			for (var i = 0; i < mapName2.length; i++) {
				newarr2.push(parseFloat(mapName2[i]));
			}
			for (var i = 0; i < mapName3.length; i++) {
				newarr3.push(parseFloat(mapName3[i]));
			}
			console.log("newarr1="+JSON.stringify(newarr1)+"==newarr2==="+JSON.stringify(newarr2)+"newarr3="+JSON.stringify(newarr3));
			//historyFunc(newarr1,newarr2,newarr3,Xarr,legenArr);//,Xarr,legenArr
			historyFunc(valueArr,Xarr,legenArr);
		}
	});

}

//echart表 开始
//function historyFunc(dataA, dataB, dataC,Xarr,legenArr) {
function historyFunc(valueArr,Xarr,legenArr) {
	var series = [];
	var colorArr = [];
	var borderColor = [];
	borderColor.push({
		color: '#9152af',
		borderColor: '#9152af',
		borderWidth: 12
	}, {
		color: '#385fa1',
		borderColor: '#385fa1',
		borderWidth: 12
	}, {
		color: '#13ab76',
		borderColor: '#13ab76',
		borderWidth: 12
	})
	colorArr.push({
		color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
			offset: 0.99,
			color: 'rgba(222,103,244, 0.2)'
		}, {
			offset: 0.9,
			color: 'rgba(222,103,244, 0.3)'
		}, {
			offset: 0.7,
			color: 'rgba(222,103,244, 0.5)'
		}, {
			offset: 0.5,
			color: 'rgba(222,103,244, 0.7)'
		}, {
			offset: 0.3,
			color: 'rgba(222,103,244, 0.8)'
		}, {
			offset: 0.1,
			color: 'rgba(222,103,244, 0.99)'
		}], false),
		shadowColor: 'rgba(0, 0, 0, 0.9)',
		shadowBlur: 10
	}, {
		color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
			offset: 0.99,
			color: 'rgba(79,148,255, 0.2)'
		}, {
			offset: 0.9,
			color: 'rgba(79,148,255, 0.4)'
		}, {
			offset: 0.7,
			color: 'rgba(79,148,255, 0.5)'
		}, {
			offset: 0.5,
			color: 'rgba(79,148,255, 0.66)'
		}, {
			offset: 0.3,
			color: 'rgba(79,148,255, 0.86)'
		}, {
			offset: 0.1,
			color: 'rgba(79,148,255, 0.99)'
		}], false),
		shadowColor: 'rgba(0, 0, 0, 0.9)',
		shadowBlur: 10
	}, {
		color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
			offset: 0.99,
			color: 'rgba(15,235,139, 0.2)'
		}, {
			offset: 0.9,
			color: 'rgba(15,235,139, 0.4)'
		}, {
			offset: 0.7,
			color: 'rgba(15,235,139, 0.5)'
		}, {
			offset: 0.5,
			color: 'rgba(15,235,139, 0.66)'
		}, {
			offset: 0.3,
			color: 'rgba(15,235,139, 0.86)'
		}, {
			offset: 0.1,
			color: 'rgba(15,235,139, 0.99)'
		}], false),
		shadowColor: 'rgba(0, 0, 0, 0.9)',
		shadowBlur: 10
	});
	//alert("valueArr.length = "+valueArr.length);
	for (var i = 0; i < valueArr.length; i++) {
		//valueArr[i]
		//alert(valueArr[i]);
		series.push({
			name: legenArr[i],
			//name: 'A相电流',
			type: 'line',
			smooth: true,
			symbol: 'circle',
			symbolSize: 5,
			showSymbol: false,
			lineStyle: {
				normal: {
					width: 3
				}
			},
			/*areaStyle: {
				normal: colorArr[i],
				normal2: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
						offset: 0.99,
						color: 'rgba(222,103,244, 0.2)'
					}, {
						offset: 0.9,
						color: 'rgba(222,103,244, 0.3)'
					}, {
						offset: 0.7,
						color: 'rgba(222,103,244, 0.5)'
					}, {
						offset: 0.5,
						color: 'rgba(222,103,244, 0.7)'
					}, {
						offset: 0.3,
						color: 'rgba(222,103,244, 0.8)'
					}, {
						offset: 0.1,
						color: 'rgba(222,103,244, 0.99)'
					}], false),
					shadowColor: 'rgba(0, 0, 0, 0.9)',
					shadowBlur: 10
				}
			},*/
			itemStyle: {
				normal: borderColor[i],
				normal1: {
					color: '#f4a240',
					borderColor: 'rgba(137,189,2,0.27)',
					borderWidth: 12
				}
			},
			//data: [, , , 34, 110, 220, 150, 75, 30, , , ]
			data: valueArr[i]
		})
		
	}
	
	
	//alert(" legenArr = "+legenArr);
	var myChart3 = echarts.init(document.getElementById('history'));
	option3 = {
		
		backgroundColor: "rgb(0,0,0,.2)",
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				lineStyle: {
					color: '#57617B'
				}
			}
		},
		legend: {

			icon: 'rect',
			data:legenArr,
			//data: ['A相电流', 'B相电流', 'C相电流'],
			align: 'right',
			right: '2%',
			top: '5%',
			textStyle: {
				color: "#fff"
			},
			itemWidth: 30,
			itemHeight: 10,
			itemGap: 15
		},
		grid: {
			left: '2%',
			right: '3%',
			top: '20%',
			bottom: '5%',
			containLabel: true
		},
		xAxis: [{
			type: 'category',
			boundaryGap: false,
			axisLine: {
				lineStyle: {
					color: '#fff'
				}
			},
			data:Xarr,
			//data: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55']
		}, {
			axisLine: {
				show: false, //上横轴
				lineStyle: {
					color: 'red',
				}
			},

		}],
		yAxis: [{
			axisLabel: {
				show: true,
				formatter: '{value}'
			},
			splitLine: {
				lineStyle: {
					color: 'rgba(255,255,255,.1)'
				}
			},
			axisLine: {
				lineStyle: {
					color: '#fff'
				}
			},
		}],
		series:[],
		series1: [{
			name:legenArr[0],
			//name: 'A相电流',
			type: 'line',
			smooth: true,
			symbol: 'circle',
			symbolSize: 5,
			showSymbol: false,
			lineStyle: {
				normal: {
					width: 3
				}
			},
			/*areaStyle: {
				normal: colorArr[i],
				normal1: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
						offset: 0.99,
						color: 'rgba(222,103,244, 0.2)'
					}, {
						offset: 0.9,
						color: 'rgba(222,103,244, 0.3)'
					}, {
						offset: 0.7,
						color: 'rgba(222,103,244, 0.5)'
					}, {
						offset: 0.5,
						color: 'rgba(222,103,244, 0.7)'
					}, {
						offset: 0.3,
						color: 'rgba(222,103,244, 0.8)'
					}, {
						offset: 0.1,
						color: 'rgba(222,103,244, 0.99)'
					}], false),
					shadowColor: 'rgba(0, 0, 0, 0.9)',
					shadowBlur: 10
				}
			},*/
			itemStyle: {
				normal: borderColor[i],
				normal1: {
					color: '#f4a240',
					borderColor: 'rgba(137,189,2,0.27)',
					borderWidth: 12
				}
			},
			data: [, , , 34, 110, 220, 150, 75, 30, , , ]
			//data: dataA
		}, {
			name:legenArr[1],
			//name: 'B相电流',
			type: 'line',
			smooth: true,
			symbol: 'circle',
			symbolSize: 5,
			showSymbol: false,
			lineStyle: {
				normal: {
					width: 3
				}
			},
			/*areaStyle: {
				normal: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
						offset: 0.99,
						color: 'rgba(79,148,255, 0.2)'
					}, {
						offset: 0.9,
						color: 'rgba(79,148,255, 0.4)'
					}, {
						offset: 0.7,
						color: 'rgba(79,148,255, 0.5)'
					}, {
						offset: 0.5,
						color: 'rgba(79,148,255, 0.66)'
					}, {
						offset: 0.3,
						color: 'rgba(79,148,255, 0.86)'
					}, {
						offset: 0.1,
						color: 'rgba(79,148,255, 0.99)'
					}], false),
					shadowColor: 'rgba(0, 0, 0, 0.9)',
					shadowBlur: 10
				}
			},*/
			itemStyle: {
				normal: {
					color: '#00ff00',
					borderColor: 'rgba(0,136,212,0.5)',
					borderWidth: 12
				}
			},
					data: [10, 180, 75, 145, 222, 165, 132, 200, 182, 61, 164, 50]
//			data: dataB
		}, {
			name:legenArr[2],
			//name: 'C相电流',
			type: 'line',
			smooth: true,
			symbol: 'circle',
			symbolSize: 5,
			showSymbol: false,
			lineStyle: {
				normal: {
					width: 3
				}
			},
			/*areaStyle: {
				normal: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
						offset: 0.99,
						color: 'rgba(15,235,139, 0.2)'
					}, {
						offset: 0.9,
						color: 'rgba(15,235,139, 0.4)'
					}, {
						offset: 0.7,
						color: 'rgba(15,235,139, 0.5)'
					}, {
						offset: 0.5,
						color: 'rgba(15,235,139, 0.66)'
					}, {
						offset: 0.3,
						color: 'rgba(15,235,139, 0.86)'
					}, {
						offset: 0.1,
						color: 'rgba(15,235,139, 0.99)'
					}], false),
					shadowColor: 'rgba(0, 0, 0, 0.9)',
					shadowBlur: 10
				}
			},*/
			itemStyle: {
				normal: {
					color: '#FFFF00',
					borderColor: 'rgba(0,136,212,0.5)',
					borderWidth: 12
				}
			},
			data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
			//data: dataC
		}]
	};
	setTimeout(function() {
		myChart3.setOption(option3,true);
	}, 500);
	option3.series = [];
	option3.series = series;
}

//echart表 结束
//今日，上周，上个月，近三个月 结束

//值班人员
//onlineFunc();
function onlineFunc(){
	//alert("online zhandianid = "+zhandianid);
	// unitid 是站点ID
	// var url="/bigtongji/getRotaList?unitid=000000000001";
	var url="/bigtongji/getRotaList?unitid="+zhandianid;
	 $.ajax({
	     cache: true,
	     type: "POST",
	     url:url,
	     data:"",
	     async: false,				   
	     success: function(data){
          // alert(data);
          console.log(data);
          var dataObj=eval("("+data+")");// 转换为json对象
          // alert(dataObj);
          // alert(dataObj);
          if(dataObj.rows.length>0){
      		 $("#onlineNotice").html('');
      		 for (var i = 0; i < dataObj.rows.length; i++) {
           		var cid= dataObj.rows[i].cid;
           		var name= dataObj.rows[i].rname;
           		var phone= dataObj.rows[i].phoneCode;
           		//alert(cid);
           		//alert("cid="+cid+"name="+name+"phone="+phone);
          		 $("#onlineNotice").append('<li><span>👨‍⚖️&nbsp;&nbsp;<span id="onlineName1">'+name+'</span>&nbsp;电话：</span><span>'+phone+'</span></li>');
           	  }
      	  }
      	 if(dataObj.rows.length==0){
      		$("#onlineNotice").html(''); 
      	 }
	     }
	 });

}
//值班人员结束

//返回上一级跳转逻辑处理
function bachFunc(){
	var urlsStr = localStorage.getItem("urls");
	var ss = JSON.parse(urlsStr);
	if(ss.sanji != undefined &&  ss.sanji !=''){
    	//alert(ss.sanji);
	    window.location.href = './specificHome.html';
    	return;
    }
    if(ss.erji != undefined && ss.erji !=''){
    	//alert(ss.erji);
	    window.location.href = './intlgMonitor.html';
	    return;
    }if(ss.yiji != undefined &&  ss.yiji !=''){
    	//alert(ss.yiji);
	    window.location.href = './pro_Home.html';
	    return;
    }else{
	   //alert(222)
    }
}

